<template>
  <div style="border: 3px solid #000; margin: 10px">
    我是子组件
    <div>传递参数1:{{ title }}</div>
    <div>传递参数2:{{ name }}</div>
    <button @click="changeTitle">修改父组件的标题</button>
  </div>
</template>

<script>
export default {
  name: "SonComp",
  props: ["title", "name"],
  methods: {
    changeTitle() {
      this.$emit("changeTitle", "我是子组件的标题");
    },
  },
};
</script>

<style></style>
